package campus.aiit.ssl.manage.cron;

import campus.aiit.ssl.service.LogService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * cmd(send message) -> socket(write)
 * socket(read) -> cmd(parse resp)
 *
 * @author
 * @date 2019/12/20 15:19
 */
@Component
public class AutoProcessingDataTask {
  @Resource
  private LogService logService;
  //每天00:00执行
  @Scheduled(cron="0 00 00 * * ?")
  private void writeLog(){

    logService.deleteDeviceLog();
    logService.addElectricConsumeLog();
  }
}